package com.qyer.lxp.common.framework.exception;

import com.qyer.lxp.common.framework.contants.ClientErrorMessageEnum;

/**
 * 对外api接口异常统一处理类
 * Created by jiangping on 16/5/16.
 */
public class QyerClientException extends Exception{

    /**
     * 错误码
     */
    private int statusCode;

    /**
     * 错误消息
     */
    private String statusMessage;

    public QyerClientException(Throwable e){
        super(e);
    }

    public QyerClientException(int code){
        super(ClientErrorMessageEnum.getErrorMessage(code));
        this.statusCode = code;
        this.statusMessage = ClientErrorMessageEnum.getErrorMessage(code);
    }

    public QyerClientException(int code, String message){
        super(message);
        this.statusCode = code;
        this.statusMessage = message;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getStatusMessage() {
        return statusMessage;
    }

    public void setStatusMessage(String statusMessage) {
        this.statusMessage = statusMessage;
    }
}
